
<form action="<?php echo U('Admin/Goods/Category/create')?>" id="create-category" method="post" class="_ajaxSubmit">
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">选择父级 :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <select class="form-control radius-none _data" name="pid">
                <option value="0">无父级</option>
                <?php echo $category_tree?>
            </select>
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">分类名称<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input name="name" type="text" autocomplete="off" class="form-control radius-none _data" >
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">缩略图<pub>*</pub> :</div>
        <div class="col-md-7 filed-from padding-none">
            <img class="thumb _thumb" data-toggle="tooltip" data-placement="top" title="允许上传 jpg , png " src="/statics/common/images/image.png" width="150" height="100">
            <input type="hidden" name="thumb" data-field="thumb" class="_data" />
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 lists text-right">
        <input type="submit" name="dosubmit" value="保存" class="btn btn-success radius-none">
        <input type="reset"  value="重置" class="btn btn-info radius-none">
    </div>
</form>
<script>

    $(function(){

        Admin.upload('._thumb');

    });

    //图片上传回调
    function getImageSrc(_this){

        $('img._thumb').attr('src',cutUrl(_this[0],150,100));

        $('input[name="thumb"]').val(_this[0]);

    }

    //表单异步提交回掉
    function ajaxRequestCallback(result,id)
    {

        switch(id){

            case 'create-category':

                showMessage(result.msg,result.code,'','',2000);

                break;

        }

    }
</script>